import { ReactElement, useContext } from 'react'
import { Row, Col, Form } from 'antd'
import style from './index.module.less'
import { Context } from '../../context'
import UnitNumberInput from '@components/unitNumberInput'
import TextCell from '@components/textCell'
import SuspensionLine from '../suspensionLine'
import SuspensionLineText from '../suspensionLine/text'

const { Item } = Form

function Main (): ReactElement {
  const { caseDetail: d } = useContext(Context)
  const disabled = d !== null && ['已确认', '抽查中', '已抽查'].includes(d.score_status)
  return (
    <div className={style.container} id='inputBlockTwo'>
      <div className={style.title}>程序复杂度</div>
      <Row>
        <Col span={9}>
          <Item label='1. 结案文书页数' name='closure_docpage'>
            {disabled ? <TextCell unit='页' /> : <UnitNumberInput unit='页' />}
          </Item>
        </Col>
        <Col span={2}><span /></Col>
        <Col span={9}>
          <Item label='2. 先行裁决' name='pre_closure_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
      </Row>
      <Row>
        <Col span={9}>
          <Item label='3. 调查勘验' name='investigate_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
        <Col span={2}><span /></Col>
        <Col span={9}>
          <Item label='4. 鉴定' name='appraisal_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
      </Row>
      <Row>
        <Col span={9}>
          <Item label='5. 仲裁员回避' name='challenge_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
        <Col span={2}><span /></Col>
        <Col span={9}>
          <Item label='6. 管辖权异议 ' name='jurisdiction_object_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
      </Row>
      <Row>
        <Col span={9}>
          <Item label='7. 变更请求' name='claimamend_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
        <Col span={2}><span /></Col>
        <Col span={9}>
          <Item label='8. 反请求' name='counterclaim_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
      </Row>
      <Row>
        <Col span={9}>
          <Item label='9. 适用程序变更/重新组庭' name='reassign_arbitrator_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
        <Col span={2}><span /></Col>
        <Col span={9}>
          <Item label='9. 追加当事人' name='party_add_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
      </Row>
      <Row>
        <Col span={9}>
          <Item label='11. 评议次数' name='expert_discuss_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
        <Col span={2}><span /></Col>
        <Col span={9}>
          <Item label='12. 专家咨询次数' name='expert_report_count'>
            {disabled ? <TextCell unit='次' /> : <UnitNumberInput />}
          </Item>
        </Col>
      </Row>
      <Row>
        <Col span={21}>
          <Item label='13. 扣除审限'>
            {disabled ? <SuspensionLineText name='trial_limit_deduct_list' /> : <SuspensionLine name='trial_limit_deduct_list' />}
          </Item>
        </Col>
      </Row>
    </div>
  )
}

export default Main
